<?php 

if (!defined('PUBLIC_HTML'))
{
	exit;
}

$page_id = (int) $_GET['id'];
if (is_numeric($page_id) && !$page_id == '')
{
	if (!$database->sqlCount(TABLE_PAGES, 'page_id', $page_id) == 1)
	{
		redirect('cms'.EXT_PHP.'?p=pages');
		exit;
	}
	else
	{
		$database->sqlDelete(TABLE_PAGES, 'page_id', $page_id);
		$database->sqlDelete(TABLE_PAGES_CONTENT, 'pct_page_id', $page_id);
		redirect('cms'.EXT_PHP.'?p=pages');
	}
}
else
{
	redirect('cms'.EXT_PHP.'?p=pages');
}

?>